1. Field of the Invention
The present invention relates to a ring oscillator clock frequency measuring method, and a ring oscillator clock frequency measuring circuit for measuring the frequency of a ring oscillator clock signal generated by a ring oscillator (square pulse generator), and to a microprocessor operating based on the ring oscillator clock signal.
2. Description of Related Art
A pulse train generated by a ring oscillator has large frequency fluctuations due to external factors such as temperature and process parameter, and hence an external oscillator like a ceramic oscillator is needed by a system requiring high frequency accuracy. Thus, a conventional system requiring high frequency accuracy cannot use a ring oscillator clock signal, but employs an external oscillator with greater current consumption than the ring oscillator.
Japanese patent application laid-open No. 58219625/1983 discloses techniques about such conventional ring oscillator clock frequency measurement and a microprocessor. FIG. 5 is a timing chart illustrating generation of a conventional ring oscillator clock signal clock count timer starting its counting in response to the start instruction, halting the counting in response to the overflow signal output from the reference clock count timer, and outputting a count value obtained during a time interval from the start to the halt of the counting.
According to a third aspect of the present invention, there is provided a microprocessor comprising: a ring oscillator pulse generator for generating a ring oscillator clock signal used by a microprocessor as its clock pulse train; a reference clock count timer for counting a number pulses of a reference clock signal generated by a reference clock generator installed outside the microprocessor, the reference clock count timer starting its counting by a start instruction, and outputting an overflow signal when the counting proceeds to a preset value; a first ring oscillator clock count timer for counting a number of pulses of a ring oscillator clock signal supplied from the ring oscillator pulse generator, the first ring oscillator clock count timer starting its counting in response to the start instruction, halting its counting in response to the overflow signal supplied from the reference clock count timer, and outputting a count value during a time interval from the start to the halt of the counting; a second ring oscillator clock count timer for counting a number of pulses of the ring oscillator clock signal generated by the ring oscillator pulse generator, the second ring oscillator clock count timer starting its down-counting when the count value of the first ring oscillator clock count timer is set to the second ring oscillator clock count timer, and outputting an overflow signal when its down-counting proceeds to zero; and a CPU for having the reference clock generator halt generating the reference clock signal in response to the overflow signal supplied from the reference clock count timer, for having the reference clock generator to restart generating the reference clock signal in response to the overflow signal supplied from the second ring oscillator clock count timer, and for supplying the start instruction to the reference clock count timer and the first ring oscillator clock count timer.
The present invention differs from the conventional ring oscillator clock signal generation disclosed in the foregoing Japanese patent application laid-open No. 58-219625/1983 in that it counts pulses of the ring oscillator clock signal for a fixed time interval defined by the reference clock signal, and then operates a microprocessor only by the ring oscillator clock signal thereafter whose frequency is known by the microprocessor.
The present invention differs from the conventional ring oscillator clock signal generation disclosed in the foregoing Japanese patent application laid-open No. 8316826/1996 in that the present invention improves the frequency accuracy by measuring the frequency of the ring oscillator clock signal, and by operating the microprocessor based on the ring oscillator clock signal whose frequency is known (but not regulated).